﻿Imports GT = Gadgeteer
Imports GTM = Gadgeteer.Modules
Imports Gadgeteer.Modules.GHIElectronics



Namespace Clicker
    Partial Public Class Program
        Dim count As Integer = 0
        Dim font As Font = Resources.GetFont(Resources.FontResources.NinaB)
        ' This is run when the mainboard is powered up or reset. 
        Public Sub ProgramStarted()
            '*******************************************************************************************
            ' Hardware modules added in the Program.gadgeteer designer view are used by typing 
            ' their name followed by a period, e.g.  button.  or  camera.
            '
            ' Many hardware modules generate useful events. To set up actions for those events, use the 
            ' left dropdown box at the top of this code editing window to choose a hardware module, then
            ' use the right dropdown box to choose the event - an event handler will be auto-generated.
            '*******************************************************************************************/

            ' Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
            Debug.Print("Program Started")
            display_N18.SimpleGraphics.DisplayText(count.ToString(), font, GT.Color.Red, 50, 50)
        End Sub

        ' If you want to do something periodically, declare a GT.Timer by uncommenting the below line
        '   and then use the dropdown boxes at the top of this window to generate a Tick event handler.
        ' Dim WithEvents timer As GT.Timer = new GT.Timer(1000)  ' every second (1000ms)

        Private Sub button_ButtonPressed(sender As Button, buttonState As Button.ButtonState) Handles button.ButtonPressed
            count = count + 1
            display_N18.SimpleGraphics.Clear()
            display_N18.SimpleGraphics.DisplayText(count.ToString(), font, GT.Color.Red, 50, 50)
        End Sub

       
 
        Private Sub button2_ButtonPressed(sender As Button, state As Button.ButtonState) Handles button2.ButtonPressed
            count = 0
            display_N18.SimpleGraphics.Clear()
            display_N18.SimpleGraphics.DisplayText(count.ToString(), font, GT.Color.Red, 50, 50)
        End Sub
    End Class
End Namespace